package com.game.server.message.proto.execute;



import java.util.ArrayList;
import java.util.Arrays;

import com.comm.ISession;
import com.game.majiang.logic.LogicClient;
import com.game.majiang.logic.LogicServer;
import com.game.majiang.logic.chexuan.ChexuanTabale;
import com.game.server.message.proto.in.AbstractZuPaiReq;
import com.game.server.system.AbstractTable;

public class ZuPaiReq extends AbstractZuPaiReq {

    @Override
    public void Execute(ISession session) {
        LogicClient client = (LogicClient) LogicServer.getInstance().getClient(session.getId());
        if (client != null&&client.checkClick(msgcode)) {
           AbstractTable abTable = client.getTable();
           if(abTable != null) {
        	   ChexuanTabale table = (ChexuanTabale) abTable;
        	   ArrayList<Integer> arrayList = new ArrayList<Integer>(Arrays.asList(this.cards));
        	   table.operateGroupCards(client, arrayList.subList(0, 2), arrayList.subList(2, 4));
           }
        }
    }

}
